﻿using Hotel.Model.Admin;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Hotel.DAL
{
    public class AdminDAL
    {
            MyDBContext db;
        public AdminDAL(MyDBContext db)
        {
            this.db = db;
        }

        /// <summary>
        /// 管理员登录
        /// </summary>
        /// <param name="username">帐号</param>
        /// <param name="pwd">密码</param>
        /// <returns></returns>
        public T_Admin GetAdminLogin(string username,string pwd)
        {
            try
            {
                T_Admin info = db.T_Admin.Where(c=>c.A_Name ==username && c.A_Pwd == pwd).FirstOrDefault();
                return info;
            }
            catch (Exception)
            {

                throw;
            }
        }
    }
}
